import java.util.Arrays;
//插入排序
public class InsertionSort {
    public static void main(String[] args) {
        int[] array = {0, 2, 3, 5, 1, 4, 6, 7, 9, 8};

        for (int i = 1; i < array.length; i++) {
            int j=i;
            while (j > 0) {
                if (array[j] < array[j - 1]) {
                    int temp = array[j - 1];
                    array[j - 1] = array[j];
                    array[j] = temp;
                    j--;
                    System.out.println(Arrays.toString(array));
                } else {
                    break;
                }
            }
            System.out.println();
        }
    }
}
